/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2024-08-28 16:14:25
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2024-08-29 17:10:34
 * @FilePath: /react18-vite-admin/src/plugins/i18n.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';

import znCn from './package/zhCn';
import en from './package/en';

export const setupI18n = () => {
    const resources = {
        'zhCn': {
            translation: znCn
        },
        en: {
            translation: en
        }
    };
    i18n.use(initReactI18next).init({
        resources,
        lng: 'zhCn',
        fallbackLng: 'zhCn',
        interpolation: {
            escapeValue: false
        },
        debug: import.meta.env.DEV
    });
};
